﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace PilotProject.CustomClasses
{
    public class ExaminerMeta
    {


        [Required(ErrorMessage = "Please enter your first name")]
        [Display(Description = "The first name of the person", Name = "First Name")]
        [RegularExpression(@"^[a-zA-Z\s\'\-]+$", ErrorMessage = "Please enter valid name.")]
        public String FirstName { get; set; }


        [Required(ErrorMessage = "Please enter your last name")]
        [Display(Description = "The family name of the person", Name = "Surname")]
        [RegularExpression(@"^[a-zA-Z\s\'\-]+$", ErrorMessage = "Please enter valid name.")]
        public String LastName { get; set; }

        [Required(ErrorMessage = "Please enter your ARN")]
        [Display(Description = "The Aviation Reference Number of the person", Name = "ARN")]
        public String ARN { get; set; }

        //[Required(ErrorMessage = "Please enter the JPA")]
        [Display(Description = "The Jump Pilot Authorisation Number", Name = "JPA")]
        public String JPA { get; set; }

        [DataType(DataType.Date)]
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd-MM-yyyy}", NullDisplayText = "")]
        [Required(ErrorMessage = "Please enter your date of birth")]
        [Display(Description = "The date of birth of the person", Name = "Date of birth")]
        public DateTime DateOfBirth
        {
            get
            {
                return this.DateOfBirth.Date;
            }
            set
            {
                this.DateOfBirth = value.Date;
            }
        }

        [Required(ErrorMessage = "A valid Email is required.")]
        [Display(Name = "Email address")]
        [RegularExpression(@"^\b[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b$", ErrorMessage = "Please enter valid email.")]
        public string Email { get; set; }
        //**

        [Required(ErrorMessage = "Enter Username")]
        [StringLength(18, ErrorMessage = "Username must be a maximum of 12 characters.")]
        public string Username { get; set; }

        [Display(Name = "Password")]
        [DataType(DataType.Password)]
        [Required]
        public string Password { get; set; }

        [Required(ErrorMessage = "Please enter your phone number")]
        [Display(Description = "The telephone number of the person", Name = "Telephone")]
        [RegularExpression(@"^((\+\d{1,3}(-| )?\(?\d\)?(-| )?\d{1,3})|(\(?\d{2,3}\)?))(-| )?(\d{3,4})(-| )?(\d{4})(( x| ext)\d{1,5}){0,1}$", ErrorMessage = "Please enter a valid telephone number.")]
        public String Telephone { get; set; }

        [Required(ErrorMessage = "Please enter your mobile phone number")]
        [Display(Description = "The telephone number of the person", Name = "Mobile Number")]
        [RegularExpression(@"^[+]?\d{10}$", ErrorMessage = "Please enter a valid mobile phone number.")]
        public String Mobile { get; set; }




    }
}

    